From b9337e864869fb322de46ab8dd52779f05a0ab95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Sun, 1 Sep 2019 21:31:37 +0100 Subject: Add type: ignore comments when using lifescan_binary_protocol.Timestamp. Somehow mypy does not seem to recognize it as a valid construct class. --- glucometerutils/drivers/otultraeasy.py | 6 +++--- glucometerutils/drivers/otverio2015.py | 6 +++--- glucometerutils/drivers/otverioiq.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/glucometerutils/drivers/otultraeasy.py b/glucometerutils/drivers/otultraeasy.py index 4005bdc..1d97ef4 100644 --- a/glucometerutils/drivers/otultraeasy.py +++ b/glucometerutils/drivers/otultraeasy.py @@ -52,13 +52,13 @@ _DATETIME_REQUEST = construct.Struct( construct.Const(b'\x05\x20'), # 0x20 is the datetime 'request_type' / construct.Enum(construct.Byte, write=0x01, read=0x02), 'timestamp' / construct.Default( - construct_extras.Timestamp(construct.Int32ul), + construct_extras.Timestamp(construct.Int32ul), # type: ignore datetime.datetime(1970, 1, 1, 0, 0)), ) _DATETIME_RESPONSE = construct.Struct( _COMMAND_SUCCESS, - 'timestamp' / construct_extras.Timestamp(construct.Int32ul), + 'timestamp' / construct_extras.Timestamp(construct.Int32ul), # type: ignore ) _GLUCOSE_UNIT_REQUEST = construct.Const( @@ -85,7 +85,7 @@ _READ_RECORD_REQUEST = construct.Struct( _READING_RESPONSE = construct.Struct( _COMMAND_SUCCESS, - 'timestamp' / construct_extras.Timestamp(construct.Int32ul), + 'timestamp' / construct_extras.Timestamp(construct.Int32ul), # type: ignore 'value' / construct.Int32ul, ) diff --git a/glucometerutils/drivers/otverio2015.py b/glucometerutils/drivers/otverio2015.py index 7e77a02..875e12e 100644 --- a/glucometerutils/drivers/otverio2015.py +++ b/glucometerutils/drivers/otverio2015.py @@ -71,12 +71,12 @@ _READ_RTC_REQUEST = construct.Const(b'\x03\x20\x02') _READ_RTC_RESPONSE = construct.Struct( _COMMAND_SUCCESS, - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore ) _WRITE_RTC_REQUEST = construct.Struct( construct.Const(b'\x03\x20\x01'), - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore ) _MEMORY_ERASE_REQUEST = construct.Const(b'\x03\x1a') @@ -105,7 +105,7 @@ _READ_RECORD_RESPONSE = construct.Struct( 'inverse_counter' / construct.Int16ul, construct.Padding(1), 'lifetime_counter' / construct.Int16ul, - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore 'value' / construct.Int16ul, 'meal' / construct.Mapping( construct.Byte, _MEAL_FLAG), diff --git a/glucometerutils/drivers/otverioiq.py b/glucometerutils/drivers/otverioiq.py index f74f51f..e058771 100644 --- a/glucometerutils/drivers/otverioiq.py +++ b/glucometerutils/drivers/otverioiq.py @@ -52,12 +52,12 @@ _READ_RTC_REQUEST = construct.Const(b'\x03\x20\x02') _READ_RTC_RESPONSE = construct.Struct( _COMMAND_SUCCESS, - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore ) _WRITE_RTC_REQUEST = construct.Struct( construct.Const(b'\x03\x20\x01'), - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore ) _GLUCOSE_UNIT_REQUEST = construct.Const( @@ -92,7 +92,7 @@ _MEAL_FLAG = { _READING_RESPONSE = construct.Struct( _COMMAND_SUCCESS, - 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, + 'timestamp' / lifescan_binary_protocol.VERIO_TIMESTAMP, # type: ignore 'value' / construct.Int16ul, 'control_test' / construct.Flag, 'meal' / construct.Mapping( -- cgit v1.2.3